<?php 
include TMPL_PATH.'public/header.phtml';
?>
<style>
.shopping-cart {
	background: url(/web/Tpl/default/images/cart/shopping-cart.png) no-repeat;
	background-size: 16px 14px;
}
.shopping-cart strong{
	padding-left: 20px;
}
</style>
<div class="subnav">
    <div class="content-menu ib-a blue line-x">
    	<div style="float:left;margin-right:50px;">
        <a href='javascript:;' class="on"><em>预约列表</em></a><span>|</span>
       
      </div>
    	<div style="color:#000;">
    	<?php 
    		$designer_id = isset($search)&& isset($search['designer_id']) ? $search['designer_id'] : -1;
    		$rank_id = isset($search)&& isset($search['rank_id']) ? $search['rank_id'] : 0;
    	?>
    		<form name="searchform" action="__SELF__"  method="post">
           客户电话：
                <input type="text" class="input-text" value="<?php echo $phone;?>" name="phone">
				<input type="submit" value="搜索" class="button" name="search">
    		</form>
    	</div>
    </div>
</div>
<div class="pad_10">
<div class="table-list">
    <table width="100%" cellspacing="0" >
        <thead>
            <tr>
            <th align='center' width="8%">客户姓名</th>
            <th align='center' width="5%">电话</th>
            <th align='center' width="5%">身高(cm)</th>
            <th align='center' width="5%">体重(kg)</th>
            <th align='center' width="7%">量体方式</th>
            <th align='center' width="5%">支付状态</th>
            <th align='center' width="25%">量体地址</th>
            <th align='center' width="10%">到店时间</th>
            <th align='center' width="20%">备注</th>
            <th align='center' width="10%">添加时间</th>
		     <th align='center' width="10%">管理操作</th>
            </tr>
        </thead>
     <tbody>
   <?php 
   	if(isset($list) && $list):
   		foreach ($list as $v):
            $pay_status=D('orders')->where(array('id'=>$v['order_id']))->getField('payment_status');
   ?>
			<tr>
					<td align='center'><?php echo $v['name'];?></td>
					<td align='center'><?php echo $v['phone'];?></td>
                    <td align='center'><?php echo $v['height'];?></td>
                    <td align='center'><?php echo $v['weight'];?></td>
                    <td align='center'><?php echo $v['class_id']==1?"到店量体":($v['class_id']==2?"上门量体":"");?></td>
                    <td align='center'>
                        <?php if($v['class_id']==1&&$v['order_id']){?>
                               <a href="<?php echo U('order/order_edit', 'oid='.$v['order_id']);?>">查看订单</a>
                        <?php }else if($v['class_id']==2){?>
                            <?php if($pay_status==OrderModel::PAY_PAYED){?>
                                <a href="<?php echo U('order/order_edit', 'oid='.$v['order_id']);?>">已支付</a>
                            <?php
                            }elseif($pay_status==OrderModel::PAY_UNPAYED){
                            ?>
                                <a href="<?php echo U('order/order_edit', 'oid='.$v['order_id']);?>">未支付</a>
                            <?php }?>
                        <?php }?>
                    </td>
                    <td align='center'><?php echo $v['address'];?></td>
                    <td align='center'><?php echo $v['class_id']==1?date("Y-m-d",$v['arrival_time']):"";?></td>
					<td align='left' style="word-break: break-all; word-wrap:break-word;"><?php echo cutstr($v['remark'],600);?></td>
                    <td align='center'><?php echo date("Y-m-d H:i:s",$v['dt_add']);?></td>
					<td align='center'>
					<a href="<?php echo U('measure/edit', 'id='.$v['id']);?>">修改</a>&nbsp;&nbsp;|&nbsp;&nbsp;
                       <!-- <a href="<?php /*echo U('measure/del', 'id='.$v['id']);*/?>">删除</a>-->
                        <a href="###" onclick="comfire(<?php echo $v['id'];?>)">删除</a>
					</td>
				</tr>
	<?php 
		endforeach;
		endif;
	?>
   </tbody>
    </table>
  <div id="pages"><?php echo $pageShow;?></div>
</div>
</div>
</body>
</html>
<script>
  function  comfire(id){
      if(confirm("确定删除吗？")){
          window.location="<?php echo U('measure/del', 'id=');?>"+id;
      }
  }
</script>